import React, {Component} from "react";
import {
	View,
	Text,
	ScrollView,
	StyleSheet,
} from "react-native";
import Icon from 'react-native-vector-icons/FontAwesome';
import ShoppingIcon from '../components/shoppingmall/shoppingIcons';
import MallList from '../components/shoppingmall/mallLists';
import ImageSwipe from "../components/public/ImageSwipe";//轮播广告
import Activity from '../components/shoppingmall/activity'
import AllDocList from '../components/serverCenter/allDocList';
import CustomTitle from '../components/public/CustomTitle';


export default class Shopping extends Component {

	static navigationOptions = {
		tabBarLabel: "商城",
		tabBarIcon: ({tintColor}) => (
			<Icon name="navicon" size={22} style={{color: gColor.color2}} />
		),
		title:"商城",
		headerTintColor:gColor.whiteColor,
		headerStyle:{
			backgroundColor:gColor.importColor,
		},
		

	}

	constructor(props) {
		super(props);
		this.state = {
			carouselItems: [
				{url: require("../imgs/health.jpg"),},
				{url: require("../imgs/lightOne.jpg"),},
				{url: require("../imgs/lightTwo.jpg"),},
			],
		}		
	}

	render() {
		return (
			<ScrollView style={{flex:1, backgroundColor:gColor.whiteColor}}>
				<ImageSwipe 
					imageArray={this.state.carouselItems}
				/>
				<ShoppingIcon navigation={this.props.navigation} />
				<CustomTitle 
					title="热门推荐"
					rightText="更多 》"
					style={styles.titleStyle}
					textStyle={styles.leftStyle}
				/>
				<MallList navigation={this.props.navigation} />
				<CustomTitle 
					title="活动专区"
					rightText="更多 》"
					style={styles.titleStyle}
					textStyle={styles.leftStyle}
				/>
				<Activity />
			</ScrollView>
		);
	}
}


const styles = StyleSheet.create({
	titleStyle:{
		borderBottomWidth: 1,
		borderColor:gColor.borderColors,
	},
	leftStyle:{
		backgroundColor:gColor.importColor,
		color:gColor.whiteColor,
		paddingHorizontal:12,
	},
})